package com.evil.kingdom.pojo.dto.alive;

import cn.hutool.core.bean.BeanUtil;
import com.evil.kingdom.pojo.entity.action.AbstractPosition;
import com.evil.kingdom.pojo.entity.action.Warfare;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author liyang
 * @date 2024-06-02 12:25
 */
@Getter
@Setter
public class AliveWarfare implements AliveMessageData, Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 名称
     * (唯一)
     */
    @NotEmpty(message = "出征名称不能为空")
    private String name;

    /**
     * 出征路段名称
     */
    @NotEmpty(message = "出征路段名称不能为空")
    private String warfareName;

    /**
     * 当前所在位置
     */
    @NotNull(message = "出征当前所在位置不能为空")
    private AbstractPosition position;

    public AliveWarfare() {
    }

    public AliveWarfare(Warfare warfare) {
        BeanUtil.copyProperties(warfare, this);
    }
}
